#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<cstdio>

using namespace std;

int main()
{
    int N, M;
    cin >> N >> M;
    for (int i = 0, k = 1; i < N; i++)
    {
        for (int j = 0; j < M; j++, k++)
        {
            if (j == M - 1)
            {
                printf("PUM");
                k++;
                break;
            }
            printf("%d ", k);
        }
        printf("\n");
    }
    return 0;
}

